package com.yan.arrays;

import java.util.Arrays;
import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("输入第" + (i + 1) + "个数");
            arr[i] = input.nextInt();
        }
        for (int i = 0 , j = arr.length - 1; i < arr.length / 2; i++ , j--) {
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        for (int i = 1; i < arr.length; i = i + 2) {
            if (i == 5) {
                int temp = arr[i];
                arr[i] = arr[1];
                arr[1] = temp;
                break;
            }
            int temp = arr[i];
            arr[i] = arr[i + 2];
            arr[i + 2] = temp;
        }
        System.out.println(Arrays.toString(arr));
    }
}
